<?php

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::match(['get', 'post'], 'activity/votedp', 'Web\Activity\ActivityController@voteDP');
Route::get('group-activity', 'Api\Activity\ActivityController@getGroupActivity');
Route::get('slice-page-activity', 'Api\Activity\ActivityController@getGroupSlicePageActivity')
->middleware('sign');

// 供app调用埋点投放的活动信息及规则
Route::get('/app/delivery/{id}', 'Api\App\ActivityController@delivery');
// 通过埋点查询投放的活动和埋点信息及规则
Route::get('/app/point', 'Api\App\ActivityController@point');
// 进入活动
Route::get('/app/activity/{id}', 'Api\App\ActivityController@show');
// 余额查询
Route::post('/app/money/balance', 'Api\App\AlipayController@momey');
// 支付宝转账
Route::post('/app/money/create', 'Api\App\AlipayController@createAction');

/*
Route::match(['get', 'post'], '/payment/alipay/notify', 'PrizePayment\AlipayController@webNotify');
Route::get('/payment/alipay/return', 'PrizePayment\AlipayController@webReturn');
Route::get('/payment/wechat/pay', 'WeChatController@pay')->middleware('log.http');
Route::match(['get', 'post'], '/payment/wechat/notify', 'WeChatController@notify')->middleware('log.http');
*/

Route::match(['get', 'post'], '/vms/callback', 'Vms\VmsController@callback');
Route::post('/vms/upload', 'Vms\VmsController@upload');


Route::get('/activities/{id}/quizzes/useable', 'Quiz\ActivityController@useable');
Route::get('/activities/{id}/quizzes', 'Quiz\ActivityController@show');
Route::get('/activities/{id}/papers', 'Quiz\ActivityController@show');
Route::post('/papers/multiple', 'Quiz\Paper\ApiController@write');
Route::post('/sheets/multiple', 'Quiz\Paper\ApiController@write');

Route::get('/winnings/{id}', 'Activity\ApiController@winnings');

Route::post('/configurations/wechat/js-sdk', 'Configuration\WechatController@makeJsSDKConfigs');

Route::post('/configurations/wechat', 'Configuration\Wechat\WebApiController@set');
Route::get('/configurations/wechat', 'Configuration\Wechat\WebApiController@getAuthorizationWechat');
Route::patch('/configurations/wechat', 'Configuration\Wechat\WebApiController@set');

Route::get('/activities/{activities}/wechat-url', 'Activity\PublishingApiController@getWechatPublishingUrl');
Route::get('/activities/{activities}/app-url', 'Activity\PublishingApiController@getAppPublishingUrl');

Route::post('/publishing/{activityId}', 'Publishing\WebApiController@publish');
Route::get('/publishing/{activityId}', 'Publishing\WebApiController@getPublished');

Route::post('/exchange', 'Prize\ApiController@doExchange');

Route::get('/vote/{activityId}/search', 'Vote\ApiController@searchCandidate');

Route::get('/logistics/companies', 'Prize\ApiController@getLogisticsCompanies');
Route::post('/prize/logistics', 'Prize\ApiController@setLogistics');